package IOStream;

import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.stream.Collectors;

public class Homework04 {
	public static void main(String[] args) throws Exception {
		String result = Files.lines(Paths.get("PXu.txt")).findFirst()
				.map(line -> Arrays.stream(line.split("-")).sorted()
				.collect(Collectors.joining("-")))
                .orElse("");
		Files.write(Paths.get("PXu.txt"), result.getBytes());
	}
}
